﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Clipping.Utils
{
    public class EnumHelper
    {
        public static List<T> GetEnumValues<T>()
        {
            Type enumType = typeof(T);
            if (!enumType.IsEnum)
                throw new Exception();
            var array = Enum.GetValues(enumType);
            List<T> rtn = new List<T>();
            foreach (var v in array)
            {
                rtn.Add((T)v);
            }

            return rtn;
        }
    }
}
